<template>
	<view class="content">
		<view class="button1">
			<button @click="showToast(message)">点击显示原生Toast</button>
		</view>
		<view class="button2">
			<button @click="processData(waitprocessdata)">回调的使用</button>
		</view>
	</view>
</template>

<script>
	const ToastPlusModule = uni.requireNativePlugin("ToastPlus")
	export default {
		data() {
			return {
				message: '我是一条很长的Toast我是一条很长的Toast',
				waitprocessdata: '我是待处理的数据'
			}
		},
		onLoad() {

		},
		methods: {
			showToast(message) {
				ToastPlusModule.showToast(message)
			},
			processData(data) {
				ToastPlusModule.processData(data, processokdata => {
					ToastPlusModule.showToast(processokdata)
				})
			}
		}
	}
</script>

<style>
	.button1 {
		display: flex;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.button2 {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		margin-top: 100rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}
</style>
